package com.me.jingdongshop.ui.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;

import com.me.common.base.Const;
import com.me.common.base.Global;
import com.me.common.util.SharedPreUtil;
import com.me.jingdongshop.R;

/**
 * Created by YL on 2017/5/4.
 */

public class SplashActivity extends AppCompatActivity {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_splash);
        Global.getMainHandler().postDelayed(new Runnable() {
            @Override
            public void run() {
                boolean isFirst = SharedPreUtil.getBoolean(Global.mContext, Const.ISFIRST_VISIT, true);
                if (isFirst) {
                    startActivity(new Intent(SplashActivity.this, GuideActivity.class));
                } else {
                    startActivity(new Intent(SplashActivity.this, MainActivity.class));
                }
                finish();
            }
        }, 1500);
    }
}
